<template>
  <el-dialog :visible.sync="visible" :title="title">
    <el-select :value="value" @change="change">
      <el-option v-for="(item,index) in nodes" :key="index" :label="item.label" :value="item.value"></el-option>
    </el-select>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" size="small" @click="confirm">确 定</el-button>
      <el-button size="small" @click="cancel">取 消</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "ApproveDialog",
  props:{
    visible:Boolean,
    title:String,
    value:Number,
    nodes:{
      type: Array,
      require:true,
      default:()=>{
        return []
      }
    }
  },
  methods:{
    change(e) {
      console.log(e)
      this.$emit('input',e)
    },
    confirm() {
      this.$emit('confirm')
    },
    cancel() {
      this.$emit('cancel')
    }
  }
}
</script>

<style scoped>

</style>